<?php
namespace TbfDocument;
class Context {
    public $config; //配置
    public $obj = array();    //正在处理的对象
    private $fieldMap = array();
    public function getFieldByName($name){
        if (empty($this->fieldMap)){
            $this->fieldMap = array();
            foreach($this->config['Field'] as $field){
                $this->fieldMap[$field['Name']] = $field;
            }
        }
        return $this->fieldMap[$name];
    }
}